package com.ovopark.organize.server.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ovopark.organize.server.model.entity.FranchiseesApprovalAddress;
import com.ovopark.organize.server.model.entity.FranchiseesRegistration;
import com.ovopark.organize.server.model.query.FranchiseesApprovalAddressQuery;

import java.util.List;

/**
 * @Description: 选点地址
 * @Author:zll
 * @Date:
 */
public interface FranchiseesApprovalAddressService {

    /** 
     * @description: 新增点位
     * @param: [address]
     * @return: com.ovopark.organize.server.model.entity.FranchiseesAddress
     * @author wxb
     * @date: 2024/6/4 10:08
     */
    FranchiseesApprovalAddress saveOrUpdateAddress(FranchiseesApprovalAddress address);

    /** 
     * @description: 分页查询
     * @param: [page, groupId, query]
     * @return: java.util.List<com.ovopark.organize.server.model.entity.FranchiseesApprovalAddress>
     * @author wxb
     * @date: 2024/6/4 10:24
     */
    IPage<FranchiseesApprovalAddress> page(Page<FranchiseesApprovalAddress> page, Integer groupId, FranchiseesApprovalAddressQuery query);

    /** 
     * @description: 查看点位
     * @param: [id]
     * @return: com.ovopark.organize.server.model.entity.FranchiseesApprovalAddress
     * @author wxb
     * @date: 2024/6/4 10:25
     */ 
    FranchiseesApprovalAddress getById(Integer id);

    /** 
     * @description: 根据点位获取线索 分页
     * @param: [page, groupId, addressId]
     * @return: com.baomidou.mybatisplus.core.metadata.IPage<com.ovopark.organize.server.model.entity.FranchiseesRegistration>
     * @author wxb
     * @date: 2024/6/4 16:12
     */ 
    IPage<FranchiseesRegistration> getPageByAddressId(Page<FranchiseesRegistration> page, Integer groupId, Integer addressId);

    /**
     * @description: 根据点位获取线索
     * @param: [groupId, addressId]
     * @return: java.util.List<com.ovopark.organize.server.model.entity.FranchiseesRegistration>
     * @author wxb
     * @date: 2024/6/5 16:20
     */
    List<FranchiseesRegistration> getByAddressId(Integer groupId, Integer addressId);

    /**
     * @description: 线索下的点位
     * @param: [registrationId, groupId]
     * @return: java.util.List<com.ovopark.organize.server.model.entity.FranchiseesApprovalAddress>
     * @author wxb
     * @date: 2024/6/6 16:32
     */
    List<FranchiseesApprovalAddress> getByRegistrationId(Integer registrationId, Integer groupId);

    /**
     * @description: 批量删除
     * @param: [idList]
     * @return: void
     * @author wxb
     * @date: 2024/6/11 18:26
     */
    void batchDeleteAddress(List<Integer> idList);

    /**
     * @description: 删除点位
     * @param: [id]
     * @return: void
     * @author wxb
     * @date: 2024/6/11 18:26
     */
    void deleteAddress(Integer id);
    
    /** 
     * @description: 地址绑定线索
     * @param: [groupId, addressId, registrationId]
     * @return: com.ovopark.organize.server.model.entity.FranchiseesApprovalAddress
     * @author wxb
     * @date: 2024/6/11 18:35
     */ 
    void addRegistration(Integer groupId, Integer addressId, Integer registrationId, Integer userId);

    /** 
     * @description: 移除线索
     * @param: [groupId, addressId, registrationId, userId]
     * @return: void
     * @author wxb
     * @date: 2024/6/12 10:12
     */ 
    void removeRegistration(Integer groupId, Integer addressId, Integer registrationId, Integer userId);
}
